public class test3 {
    //输出闰年
    public static void main(String[] args) {
        System.out.println("1000~2000年的闰年有:");
        int count = 0;
        for (int i = 1000; i <2001 ; i++) {
            if((i%100!=0&&i%4==0)||(i%400==0)){
                System.out.print(" "+i+" ");
                count++;
                if(count%20==0){
                    System.out.println();
                }
            }
        }
        System.out.println("一共有"+count+"个闰年");
    }
}
